<!DOCTYPE html>
<html>

	<head>
		<title>我的消息</title>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<link rel="stylesheet" href="/js/bootstrap/css/bootstrap.css">
		<script src="/js/jquery/jquery.min.js"></script>
		<script src="/js/bootstrap/js/bootstrap.js"></script>
		<link rel="stylesheet" href="/css/font/css/font-awesome.min.css" />
		<link rel="stylesheet" href="/css/reset.css" />
		<link rel="stylesheet" href="/css/message.css" />
		<script src="/js/plugins/jrender/jrender.js"></script>
		<script>
			//拿到当前登录的用户
            //拿到当前登录的用户，要求必须登录之后才能评论
            var currentuser ;
            currentuser = JSON.parse(sessionStorage.getItem("user"));
            //查到指定该用户的所有的赞的条数，主要是做了赞游记的

			$.get("/users/"+currentuser.id+"/praises",function (data) {
				//拿到当前被点赞的总数据，开始渲染
                if(data){
                    $(".like").html(data);
                }

            })


			$.get("/users/"+currentuser.id+"/comment/total",function (data) {
				//拿到当前被评论的总数据，开始渲染
                if(data){
                    $(".comment").html(data);
                }

            })

            $.get("/users/"+currentuser.id+"/sms/total",function (data) {
                //拿到当前被评论的总数据，开始渲染
                if(data){
                    $(".sms").html(data);
                }
            })
            $.get("/users/"+currentuser.id+"/systemmessages/total",function (data) {
                //拿到当前被评论的总数据，开始渲染
                if(data){
                    $(".systemmessage").html(data);
                }
            })
			//获取所有的系统通知，进行下方的渲染
			$.get("/systemmessage",function (data) {
				$(".systemMsg").renderValues({list:data})
            })

		</script>
	</head>

	<body>
		<div class="search-head">
			<div class="row nav-search">
				<div class="col">
					<a href="javascript:history.go(-1);">
						<span><i class="fa fa-chevron-left" ></i></span>
					</a>
				</div>
				<div class="col">
					<span>我的消息</span>
				</div>
				<div class="col"></div>
			</div>
		</div>

		<ul class="list-group">
			<a href="/mine/likeTravelMessage.html?type=1">
				<li class="list-group-item d-flex justify-content-between align-items-center">
					<div class="item">
						<span><i class="fa fa-thumbs-o-up" ></i></span>
						<span>赞</span>
						<span class="badge badge-danger badge-pill like"></span>
					</div>
					<i class="fa fa-chevron-right"></i>
				</li>
			</a>
			<a href="../index.html">
				<li class="list-group-item d-flex justify-content-between align-items-center">
					<div class="item">
						<span><i class="fa fa-at" ></i></span>
						<span>@我的</span>
						<span class="badge badge-danger badge-pill"></span>
					</div>
					<i class="fa fa-chevron-right"></i>
				</li>
			</a>
			<a href="/mine/commentMyMessage.html?type=2">
				<li class="list-group-item d-flex justify-content-between align-items-center">
					<div class="item">
						<span><i class="fa fa-commenting-o" ></i>	</span>
						<span>评论</span>
						<span class="badge badge-danger badge-pill comment"></span>
					</div>
					<i class="fa fa-chevron-right"></i>
				</li>
			</a>
			<a href="/mine/SmsMessage.html?type=4">
				<li class="list-group-item d-flex justify-content-between align-items-center">
					<div class="item">
						<span><i class="fa fa-envelope-o" ></i></span>
						<span>	私信</span>
						<span class="badge badge-danger badge-pill sms"></span>
					</div>
					<i class="fa fa-chevron-right"></i>
				</li>
			</a>
			<a href="/mine/systemMessage.html" id="system">
				<li class="list-group-item d-flex justify-content-between align-items-center">
					<div class="item">
						<span><i class="fa fa-bell" ></i></span>
						<span>系统通知</span>
						<span class="badge badge-danger badge-pill systemmessage"></span>
					</div>
					<i class="fa fa-chevron-right"></i>
				</li>
			</a>
		</ul>
		
			<div class="container systemMsg">
					<dl class="itemList" render-loop="list">
						<dd>
							<p render-html="list.content"></p>
							<p>-- 骡窝官方</p>
							<p render-html="list.releaseTime"></p>
						</dd>
					</dl>
				</div>

	</body>

</html>